<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <h:head>
        <title>Choose Your Roles</title>
    </h:head>
    <f:view beforePhase="#{UserDisplayManagedBean.doDisplay}">
        <h:body>
            <h:form>
              
                <!-- IDLE DIALOG for -->
                <p:confirmDialog message="You have been idle for 5 minutes. Do you want to continue?"  
                                 showEffect="bounce" hideEffect="explode"  
                                 header="Warning message" severity="alert" widgetVar="confirmation">  
                    <p:commandButton value="Yes" onclick="confirmation.hide()" type="button" /> 
                    <p:commandButton value="No" update="panel" oncomplete="confirmation.hide()"  
                                     actionListener="#{UserManagedBean.doLogout}" /> 
                </p:confirmDialog>

                <p:idleMonitor timeout="300000" onidle="confirmation.show()" />  
                <!--END OF IDLE DIALOG-->
                    
                <div id="top" class="top">
                    <h:graphicImage value="/image/newHeader.jpg"/>
                </div>

                <div id="content">
                    <p:panel style="height:490px;width: 1340px">
                        <center>
                            <p:panel style=" border-style: dashed; width:500px">
                                <h3>Welcome #{UserDisplayManagedBean.email}</h3>

                                <h:selectOneMenu required="true" immediate="true"  requiredMessage="Please choose one role!" value="#{UserManagedBean.selectedRole}">
                                    <f:selectItem itemLabel="Select Your Role" itemValue=""/>
                                    <f:selectItems value="#{UserDisplayManagedBean.roles}" var="role" itemValue="#{role}"/> 
                                </h:selectOneMenu> 
                                <p/>
                                <p:commandButton type="submit" value="Choose Role" actionListener="#{UserManagedBean.doRedirectRole}"/> 
                                <p:commandButton type="submit" immediate="true" value="Logout" actionListener="#{UserManagedBean.doLogout}"/>                         
                            </p:panel>
                        </center>
                    </p:panel>
                </div>

                <div id="bottom" class="footer">
                    <h:graphicImage value="/image/merlionfooter.jpg"/>
                </div>
            </h:form>
        </h:body>
    </f:view>
</html>

